package demo5;
public class Test {
    public static void main(String[] args) {
        littleMonkey littleMoney1 = new littleMonkey("悟空");
        littleMoney1.flying();
        littleMoney1.climbing();
        littleMoney1.swimming();
    }
}
class Monkey{
    public String name;

    public Monkey(String name) {
        this.name = name;
    }
    public void climbing(){
        System.out.println(name+"会爬树");
    }
    public String getName(){
        return name;
    }
}
interface Fishable{
    void swimming();
}
interface Flyable{
    void flying();
}
//-------------------------------------------------
class littleMonkey extends Monkey implements Fishable,Flyable{
    public littleMonkey(String name) {
        super(name);
    }

    @Override
    public void swimming() {
        System.out.println(getName()+"通过学习，可以学会游泳");
    }

    @Override
    public void flying() {
        System.out.println(getName()+"通过学习，可以学会飞翔");
    }
}
